import { DEFAULT_FIXTURE_ACCOUNT } from '../../framework/fixtures/FixtureBuilder';

const defiApiDataMockResponse = [
  {
    protocolId: 'aave-v2',
    name: 'Aave v2 AToken',
    description: 'Aave v2 defi adapter for yield-generating token',
    siteUrl: 'https://aave.com/',
    iconUrl: '',
    positionType: 'supply',
    chainId: 1,
    productId: 'a-token',
    metadata: {
      groupPositions: true,
    },
    protocolDisplayName: 'Aave V2',
    chainName: 'ethereum',
    success: true,
    tokens: [
      {
        address: '0x3Ed3B47Dd13EC9a98b44e6204A523E766B225811',
        name: 'Aave interest bearing USDT',
        symbol: 'aUSDT',
        decimals: 6,
        balanceRaw: '300106',
        type: 'protocol',
        tokens: [
          {
            address: '0xdAC17F958D2ee523a2206206994597C13D831ec7',
            name: 'Tether USD',
            symbol: 'USDT',
            decimals: 6,
            type: 'underlying',
            balanceRaw: '300106',
            balance: 0.300106,
            price: 0.99994,
            iconUrl:
              'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xdAC17F958D2ee523a2206206994597C13D831ec7/logo.png',
          },
        ],
        balance: 0.300106,
      },
      {
        address: '0x030bA81f1c18d280636F32af80b9AAd02Cf0854e',
        name: 'Aave interest bearing WETH',
        symbol: 'aWETH',
        decimals: 18,
        balanceRaw: '20000539486338',
        type: 'protocol',
        tokens: [
          {
            address: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',
            name: 'Wrapped Ether',
            symbol: 'WETH',
            decimals: 18,
            type: 'underlying',
            balanceRaw: '20000539486338',
            balance: 0.000020000539486338,
            price: 1599.45,
            iconUrl:
              'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png',
          },
        ],
        balance: 0.000020000539486338,
      },
    ],
  },
  {
    protocolId: 'aave-v3',
    name: 'Aave v3 AToken',
    description: 'Aave v3 defi adapter for yield-generating token',
    siteUrl: 'https://aave.com/',
    iconUrl: '',
    positionType: 'supply',
    chainId: 1,
    productId: 'a-token',
    metadata: {
      groupPositions: true,
    },
    protocolDisplayName: 'Aave V3',
    chainName: 'ethereum',
    success: true,
    tokens: [
      {
        address: '0x23878914EFE38d27C4D67Ab83ed1b93A74D4086a',
        name: 'Aave Ethereum USDT',
        symbol: 'aEthUSDT',
        decimals: 6,
        balanceRaw: '300112',
        type: 'protocol',
        tokens: [
          {
            address: '0xdAC17F958D2ee523a2206206994597C13D831ec7',
            name: 'Tether USD',
            symbol: 'USDT',
            decimals: 6,
            type: 'underlying',
            balanceRaw: '300112',
            balance: 0.300112,
            price: 0.99994,
            iconUrl:
              'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xdAC17F958D2ee523a2206206994597C13D831ec7/logo.png',
          },
        ],
        balance: 0.300112,
      },
      {
        address: '0xfA1fDbBD71B0aA16162D76914d69cD8CB3Ef92da',
        name: 'Aave Ethereum Lido WETH',
        symbol: 'aEthLidoWETH',
        decimals: 18,
        balanceRaw: '9030902767263172',
        type: 'protocol',
        tokens: [
          {
            address: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',
            name: 'Wrapped Ether',
            symbol: 'WETH',
            decimals: 18,
            type: 'underlying',
            balanceRaw: '9030902767263172',
            balance: 0.00903090276726317,
            price: 1599.45,
            iconUrl:
              'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png',
          },
        ],
        balance: 0.00903090276726317,
      },
    ],
  },
  {
    protocolId: 'uniswap-v2',
    name: 'UniswapV2',
    description: 'UniswapV2 pool adapter',
    siteUrl: 'https://v2.info.uniswap.org/home',
    iconUrl: '',
    positionType: 'supply',
    chainId: 59144,
    productId: 'pool',
    protocolDisplayName: 'Uniswap V2',
    chainName: 'arb',
    success: true,
    tokens: [
      {
        address: '0xF64Dfe17C8b87F012FCf50FbDA1D62bfA148366a',
        name: 'Uniswap V2 WETH / USDC',
        symbol: 'UNI-V2/WETH/USDC',
        decimals: 18,
        balanceRaw: '42930233173',
        type: 'protocol',
        tokens: [
          {
            address: '0x82aF49447D8a07e3bd95BD0d56f35241523fBab1',
            name: 'Wrapped Ether',
            symbol: 'WETH',
            decimals: 18,
            type: 'underlying',
            balanceRaw: '1328682329199896',
            balance: 0.0013286823291999,
            price: 1596.15,
            iconUrl:
              'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/arbitrum/assets/0x82aF49447D8a07e3bd95BD0d56f35241523fBab1/logo.png',
          },
          {
            address: '0xaf88d065e77c8cC2239327C5EDb3A432268e5831',
            name: 'USD Coin',
            symbol: 'USDC',
            decimals: 6,
            type: 'underlying',
            balanceRaw: '2121732',
            balance: 2.121732,
            price: 0.999931,
            iconUrl:
              'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/arbitrum/assets/0xaf88d065e77c8cC2239327C5EDb3A432268e5831/logo.png',
          },
        ],
        balance: 4.2930233173e-8,
      },
    ],
  },
  {
    protocolId: 'uniswap-v3',
    name: 'UniswapV3',
    description: 'UniswapV3 defi adapter',
    siteUrl: 'https://uniswap.org/',
    iconUrl:
      'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984/logo.png',
    positionType: 'supply',
    chainId: 59144,
    productId: 'pool',
    protocolDisplayName: 'Uniswap V3',
    chainName: 'arb',
    success: true,
    tokens: [
      {
        address: '0xC36442b4a4522E871399CD717aBDD847Ab11FE88',
        tokenId: '4198285',
        name: 'WETH / USDC - 0.05%',
        symbol: 'WETH / USDC - 0.05%',
        decimals: 18,
        balanceRaw: '51819988773',
        type: 'protocol',
        tokens: [
          {
            address: '0x82aF49447D8a07e3bd95BD0d56f35241523fBab1',
            name: 'Wrapped Ether',
            symbol: 'WETH',
            decimals: 18,
            balanceRaw: '1297885712689618',
            type: 'underlying',
            balance: 0.00129788571268962,
            price: 1596.15,
            iconUrl:
              'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/arbitrum/assets/0x82aF49447D8a07e3bd95BD0d56f35241523fBab1/logo.png',
          },
          {
            address: '0x82aF49447D8a07e3bd95BD0d56f35241523fBab1',
            name: 'Wrapped Ether',
            symbol: 'WETH',
            decimals: 18,
            balanceRaw: '59946788255878',
            type: 'underlying-claimable',
            balance: 0.000059946788255878,
            price: 1596.15,
            iconUrl:
              'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/arbitrum/assets/0x82aF49447D8a07e3bd95BD0d56f35241523fBab1/logo.png',
          },
          {
            address: '0xaf88d065e77c8cC2239327C5EDb3A432268e5831',
            name: 'USD Coin',
            symbol: 'USDC',
            decimals: 6,
            balanceRaw: '2068988',
            type: 'underlying',
            balance: 2.068988,
            price: 0.999931,
            iconUrl:
              'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/arbitrum/assets/0xaf88d065e77c8cC2239327C5EDb3A432268e5831/logo.png',
          },
          {
            address: '0xaf88d065e77c8cC2239327C5EDb3A432268e5831',
            name: 'USD Coin',
            symbol: 'USDC',
            decimals: 6,
            balanceRaw: '39876',
            type: 'underlying-claimable',
            balance: 0.039876,
            price: 0.999931,
            iconUrl:
              'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/arbitrum/assets/0xaf88d065e77c8cC2239327C5EDb3A432268e5831/logo.png',
          },
        ],
        balance: 5.1819988773e-8,
      },
      {
        address: '0xC36442b4a4522E871399CD717aBDD847Ab11FE88',
        tokenId: '4218057',
        name: 'WETH / USDC - 0.01%',
        symbol: 'WETH / USDC - 0.01%',
        decimals: 18,
        balanceRaw: '52094479394',
        type: 'protocol',
        tokens: [
          {
            address: '0x82aF49447D8a07e3bd95BD0d56f35241523fBab1',
            name: 'Wrapped Ether',
            symbol: 'WETH',
            decimals: 18,
            balanceRaw: '1304830266255102',
            type: 'underlying',
            balance: 0.0013048302662551,
            price: 1596.15,
            iconUrl:
              'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/arbitrum/assets/0x82aF49447D8a07e3bd95BD0d56f35241523fBab1/logo.png',
          },
          {
            address: '0x82aF49447D8a07e3bd95BD0d56f35241523fBab1',
            name: 'Wrapped Ether',
            symbol: 'WETH',
            decimals: 18,
            balanceRaw: '12367250795581',
            type: 'underlying-claimable',
            balance: 0.000012367250795581,
            price: 1596.15,
            iconUrl:
              'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/arbitrum/assets/0x82aF49447D8a07e3bd95BD0d56f35241523fBab1/logo.png',
          },
          {
            address: '0xaf88d065e77c8cC2239327C5EDb3A432268e5831',
            name: 'USD Coin',
            symbol: 'USDC',
            decimals: 6,
            balanceRaw: '2079837',
            type: 'underlying',
            balance: 2.079837,
            price: 0.999931,
            iconUrl:
              'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/arbitrum/assets/0xaf88d065e77c8cC2239327C5EDb3A432268e5831/logo.png',
          },
          {
            address: '0xaf88d065e77c8cC2239327C5EDb3A432268e5831',
            name: 'USD Coin',
            symbol: 'USDC',
            decimals: 6,
            balanceRaw: '25065',
            type: 'underlying-claimable',
            balance: 0.025065,
            price: 0.999931,
            iconUrl:
              'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/arbitrum/assets/0xaf88d065e77c8cC2239327C5EDb3A432268e5831/logo.png',
          },
        ],
        balance: 5.2094479394e-8,
      },
    ],
  },
];

export const defiPositionsWithNoData = {
  urlEndpoint: `https://defiadapters.api.cx.metamask.io/positions/${DEFAULT_FIXTURE_ACCOUNT}`,
  response: { data: [] },
  responseCode: 200,
};

export const defiPositionsError = {
  urlEndpoint: `https://defiadapters.api.cx.metamask.io/positions/${DEFAULT_FIXTURE_ACCOUNT}`,
  response: { error: 'Internal server error' },
  responseCode: 500,
};

export const defiPositionsWithData = {
  urlEndpoint: `https://defiadapters.api.cx.metamask.io/positions/${DEFAULT_FIXTURE_ACCOUNT}`,
  response: { data: defiApiDataMockResponse },
  responseCode: 200,
};
